// 防抖
export function _debounce(fn, delay) {
  var delay = delay || 200
  var timer
  return function() {
    var th = this
    var args = arguments
    if (timer) {
      clearTimeout(timer)
    }
    timer = setTimeout(function() {
      timer = null
      fn.apply(th, args)
    }, delay)
  }
}

/*
使用方法
import { _debounce } from "@/utils/debounce";
methods: {
    changefield: _debounce(function(_type, index, item) {
        // do something ...
    }, 200)
}*/
